UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't+4p02GlVUabMRP/z607Z2dCWEFEfqzpCJCBY58l7p0='
WHERE
key_id = '6d59e2859e7efaa85ea1a6ecb573790de2ea26315a7249234c3f39a3aeda7b7d'
AND (
token = 't+4p02GlVUabMRP/z607Z2dCWEFEfqzpCJCBY58l7p0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)