UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xZdIAQ+KKs9HdmPIxFr6Wx8k3eid0E4K7v5m3h4KRuI=' 
WHERE 
  key_id = '7e5226bb9685bf312f5b9eaf58b1e38d4c0157207bb1b9b24a4d0e6abaf5ec49' 
  AND (
    token = 'xZdIAQ+KKs9HdmPIxFr6Wx8k3eid0E4K7v5m3h4KRuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020