UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PdDOHs8OdoboNfdzFkqebE3LLR465DS5oSQ+8/oQWU8=' 
WHERE 
  key_id = 'efa694f27b63f3f30a245d56e9c5e66ca2ca8f51e921ea8355cd64592dad7fc4' 
  AND (
    token = 'PdDOHs8OdoboNfdzFkqebE3LLR465DS5oSQ+8/oQWU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035