UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yxORkaue3DircexLSzB4KLKdejfVAnLUFI0l9O1edhE=' 
WHERE 
  key_id = '5630dcfa8db88ca2e6b775e9e96ff13d5c85d8b7c6e5434f40858af009537dcd' 
  AND (
    token = 'yxORkaue3DircexLSzB4KLKdejfVAnLUFI0l9O1edhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042