UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZFRkcLCkHPwhaRkCeZPtvb+8s5HwS+IKi7GTvxqsmEY='
WHERE
key_id = '0cf515aa5a49a8a6b5e099e95621241da4d95acdd8d5a007d04afa75d63ac417'
AND (
token = 'ZFRkcLCkHPwhaRkCeZPtvb+8s5HwS+IKi7GTvxqsmEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)