UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Um9o6/WRY9MhIlIu7TrVHBqAVriPDnM9qBJ9bWBA5Uo=' 
WHERE 
  key_id = '4820e20f92c9a45eccfcaeadb7c44a981a8b09fceeae7a1bc13f805d5e08059f' 
  AND (
    token = 'Um9o6/WRY9MhIlIu7TrVHBqAVriPDnM9qBJ9bWBA5Uo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031