UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CtTMU9Kkee7gXgghMpTS7+efGlO0ZrZVOQQ3oxrRLb4='
WHERE
key_id = '951c6fedc74afb55028a57222e363ba77dfd2be946a4c3640ffc9ada6b272e74'
AND (
token = 'CtTMU9Kkee7gXgghMpTS7+efGlO0ZrZVOQQ3oxrRLb4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)