UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '22M8j0Uxq6raw/NsQNbrdY5fzw6KuzleUFx5551OtKc='
WHERE
key_id = '45501242c54a776b38152e1b1328db464838d13bb5165a8fb3f4aac137606174'
AND (
token = '22M8j0Uxq6raw/NsQNbrdY5fzw6KuzleUFx5551OtKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)