UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Z6Mc/vON2Md1vfiMLBvku4zUzynO9Mk4jgxfBNdLUo='
WHERE
key_id = '57e0c2692c3c1785b16f06353a1ccb4c555fb2941a64f4621f44c2be1d8b3ebc'
AND (
token = '7Z6Mc/vON2Md1vfiMLBvku4zUzynO9Mk4jgxfBNdLUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)