UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIzS/IYdypF4hv1SWsEXVeL4t07arm9hfxEDNn+tLcQ=' 
WHERE 
  key_id = '27d796cd3b7f3635cd2a441e5ea602f148d81e10ec6434f5dc4497182fd70b68' 
  AND (
    token = 'EIzS/IYdypF4hv1SWsEXVeL4t07arm9hfxEDNn+tLcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041