UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gnUzZcnDtGBWMDaQe90BFB6TdwFg4O5g86jJ0EHWpnc=' 
WHERE 
  key_id = '1ce433199a8e6aa459c2712eb257355501e8b7c2a192f1913cdfcc81889721d3' 
  AND (
    token = 'gnUzZcnDtGBWMDaQe90BFB6TdwFg4O5g86jJ0EHWpnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028