UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FYWJN626UaKO0ZK5b4TLbNIsS9IpMSVZtbk+Ldfs8bY=' 
WHERE 
  key_id = '18a50d2e311137ce4fb3344496fe3628298f828143553d7c6c62915c58f9e79a' 
  AND (
    token = 'FYWJN626UaKO0ZK5b4TLbNIsS9IpMSVZtbk+Ldfs8bY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029