UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4PXOG+UIC03aOTJ6eOL4JszoDAG9Heah59uxd/iNWRM='
WHERE
key_id = 'f49f5eb25fb415ce6b72efaed684790ea72f68aaee20c48f388a4c8433475549'
AND (
token = '4PXOG+UIC03aOTJ6eOL4JszoDAG9Heah59uxd/iNWRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)