UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HBXBM2rDpOcai4MdoqNpSOEf13jal+NDicYlaROBLWU='
WHERE
key_id = '684a853e3ff0b1f2546a67bdba86ef88cca9794da1261f061158d1e045414537'
AND (
token = 'HBXBM2rDpOcai4MdoqNpSOEf13jal+NDicYlaROBLWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)