UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lMcVJYeJHxwPxN8vDihtJ/fb+OFIdVd1TU+I4ukLIyA='
WHERE
key_id = '2b563b6eb19dfc0a02782ffd04e8fb6b3f9c0086feeff3369f3a7309a74af0a4'
AND (
token = 'lMcVJYeJHxwPxN8vDihtJ/fb+OFIdVd1TU+I4ukLIyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)