UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'deao08doBCVpkhG3cj/94uZx2+v+7ErgHF1r/gKwyQo='
WHERE
key_id = 'a6a9bfaf389bb24415f09b0622281c5bf2d06c3f725d37344e9d54f890e61d8d'
AND (
token = 'deao08doBCVpkhG3cj/94uZx2+v+7ErgHF1r/gKwyQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)