UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F5yJaOgR7pmcnYB6uuTG82MCyEAFitPJ67iabRs6K/c=' 
WHERE 
  key_id = '0c7db0562cd5c2286c27c538d4218c34fd136da06bd3dc7a15e0c3d6332fe043' 
  AND (
    token = 'F5yJaOgR7pmcnYB6uuTG82MCyEAFitPJ67iabRs6K/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038