UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'll9SGE6lhKZcWVDoDE1zCUUaMy+pB7Ofnz160m0F8yg='
WHERE
key_id = '463c00250dd755b6e9cb9043b6db8e80811cec0642e383f6ee83229c2fb91b46'
AND (
token = 'll9SGE6lhKZcWVDoDE1zCUUaMy+pB7Ofnz160m0F8yg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)