UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w7Bt1O8cg/fzTAzdnUpPwOAJ/L/ULJL1Zhh8CfxJF78=' 
WHERE 
  key_id = 'ecf8c2d4ef2321fb866421b6728ed1c344c443207abd8abb1460aa3ed1fe70ac' 
  AND (
    token = 'w7Bt1O8cg/fzTAzdnUpPwOAJ/L/ULJL1Zhh8CfxJF78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029