UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'moDisVw6CqaUOBIHAuhj+6D/ofypXjwFs+3jGxeHT6I='
WHERE
key_id = '41823da59970226fdcc68c9a737e641900ff329e7c788bee4e515ec1a876a42d'
AND (
token = 'moDisVw6CqaUOBIHAuhj+6D/ofypXjwFs+3jGxeHT6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)