UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S64O6OXRuC3qWMf0y4HTXfLLu9l9sNCTWc9S3GvZp34='
WHERE
key_id = '5fdcad791bcaff00105fb89022618d89e764cd02dd53f38f92d0d265ed956bbb'
AND (
token = 'S64O6OXRuC3qWMf0y4HTXfLLu9l9sNCTWc9S3GvZp34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)