UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'leR7yhLEQAzpCLWQd+cLV0DQjNGlpPr2Jt1+OcLh9IA=' 
WHERE 
  key_id = 'b61cbba8918e9e2220fc5751cbfa401014c1e8566dd533a85c8bd4d689ac6e41' 
  AND (
    token = 'leR7yhLEQAzpCLWQd+cLV0DQjNGlpPr2Jt1+OcLh9IA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035