UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Aecdm+54/KjGQyKhh7HdBX+HKgdcf53V62m+ZyukRsY='
WHERE
key_id = '26de954b5205fac3896b596b307a281e205ca5b00dd458fbc61a15a479355696'
AND (
token = 'Aecdm+54/KjGQyKhh7HdBX+HKgdcf53V62m+ZyukRsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)