UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5bJD2MP1E6DD158SWp6lNlOHq9aj4pYF7heOJJA7G0w='
WHERE
key_id = '4dc5d075887ed5a5450dda57299d98aedaf0e2f1bf2631712976b9c7b6ca4141'
AND (
token = '5bJD2MP1E6DD158SWp6lNlOHq9aj4pYF7heOJJA7G0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)