UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EIX6lZQbx383xNFZcO0+HlEa6DWxZYL3Rnf0JinH3gc='
WHERE
key_id = 'd5603746730816570de0799bd12d83d904953bf52ac90c5450280d2128ddb4f2'
AND (
token = 'EIX6lZQbx383xNFZcO0+HlEa6DWxZYL3Rnf0JinH3gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)