UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LRsnDpzOVVA/e7NfBSDcTTZBg2naAOEGEHRzLmAJKIE='
WHERE
key_id = 'c9960bbd4dce87e94655aa01af5a4c89b42cfd2a1c18ee3d42d9f09e843c60f9'
AND (
token = 'LRsnDpzOVVA/e7NfBSDcTTZBg2naAOEGEHRzLmAJKIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)