UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b4w6xBJrfh3b3b6XhFXRnG5GtlyK8BjotxSq8h1Cb1U='
WHERE
key_id = '25913df14690e92bc07da8fa262368b402b19bd335e5e48981e5fc162e5865b3'
AND (
token = 'b4w6xBJrfh3b3b6XhFXRnG5GtlyK8BjotxSq8h1Cb1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)