UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'as1KQhkiGJ5KZtT0/LT8LYDCu0C4fwvbUvQXnRStq1c='
WHERE
key_id = '3a3f37ba985d035b57c96ca9daf713014dc495a43c7193635c1460355a3670ed'
AND (
token = 'as1KQhkiGJ5KZtT0/LT8LYDCu0C4fwvbUvQXnRStq1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)