UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TbZSIo20JEHX20ZNCmAc+qM9R2CLiyLWOU9X/9gUWBo='
WHERE
key_id = 'b4539911b4dbbb925d69a159565fd1840efe6909731d2a5fdf4b1844526c1093'
AND (
token = 'TbZSIo20JEHX20ZNCmAc+qM9R2CLiyLWOU9X/9gUWBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)