UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9X1+DAGt+O69rwWrvZI3nTtZLtsdiHZB8eFWJypUvtg='
WHERE
key_id = 'f02030ae634c8ad06affc8a945c7d92186af18a9d7ce1ebb6d4ea3d5782955ee'
AND (
token = '9X1+DAGt+O69rwWrvZI3nTtZLtsdiHZB8eFWJypUvtg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)