UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0cM2k6qPXpjEuRK107dQTkHhRWGH2GbJg6dVNHcjezA=' 
WHERE 
  key_id = 'e4b672947bb650dded432c1b5c04f44840491c626794a0c1201970f9eef93375' 
  AND (
    token = '0cM2k6qPXpjEuRK107dQTkHhRWGH2GbJg6dVNHcjezA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040