UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4VD0qtRKdPTdOwSB4q2HUoDHsgBeiODcqj2YGR5ZSKk='
WHERE
key_id = '89ca76af9477a7ceeab78803fd3354fe12a3a6b2be8a533d0682d5649dc01d34'
AND (
token = '4VD0qtRKdPTdOwSB4q2HUoDHsgBeiODcqj2YGR5ZSKk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)