UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O2xAP4fIVqV91oOCHkAkKAZbRZtpRnvxDYpFynxMGlE='
WHERE
key_id = '3e706b97d048ff94b2ff7886dc6c0f206aeb5c61752b9f2f5778dacb3b690837'
AND (
token = 'O2xAP4fIVqV91oOCHkAkKAZbRZtpRnvxDYpFynxMGlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)