UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SyPHKMd/L8R0ZMax2clwkh2Egj/V5dFpFgI03oJajSI=' 
WHERE 
  key_id = 'e6f81cfc0d716cd4de49b00080205803e5867ec9a2a8e487031cd80f77b8518b' 
  AND (
    token = 'SyPHKMd/L8R0ZMax2clwkh2Egj/V5dFpFgI03oJajSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037