UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vS+/LbqPh9DHWZaiI/MjudTpBFX+C1mbdZH915F9G88='
WHERE
key_id = '5cdc2132ae4bd320bd359791e556b59f00fa6122559f31d8f27fb98cb6885e7a'
AND (
token = 'vS+/LbqPh9DHWZaiI/MjudTpBFX+C1mbdZH915F9G88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)