UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mWmuxowtqd0qLmqEbxsB/OJEL9pRJExAtdFknYSXVGk=' 
WHERE 
  key_id = 'a9e7df164cec30bf2152cb4f28bd2c44e822361bfa07b054cb30d507062d6853' 
  AND (
    token = 'mWmuxowtqd0qLmqEbxsB/OJEL9pRJExAtdFknYSXVGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023