UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PRrCODXSD2kcJH3xGa3uKnTh06dholP8YnTsAnYCl4M=' 
WHERE 
  key_id = 'eefb1c48ad933a44f54ba95e319245ab293ef6bc04baf67ee0e64a9c19912ed8' 
  AND (
    token = 'PRrCODXSD2kcJH3xGa3uKnTh06dholP8YnTsAnYCl4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030