UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8jf7C4cEaLWhpGjV79LuzpyoMg+GDXx0hoTsc5Eo4SQ=' 
WHERE 
  key_id = '8d8bb1fe0d18772601020d3db7c9b51e8221199bf49e8aa6c5958d759ff9f570' 
  AND (
    token = '8jf7C4cEaLWhpGjV79LuzpyoMg+GDXx0hoTsc5Eo4SQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022