UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2SUaW5tcBbPrM7qTB59sWjTJwjwU5ypJDGti70kUGJE=' 
WHERE 
  key_id = '979617282186d9ca30bc046090169074570457c08fb81016cedb7bfb03711b95' 
  AND (
    token = '2SUaW5tcBbPrM7qTB59sWjTJwjwU5ypJDGti70kUGJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037