UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hhuKHt25NqGLF34MypYAKRnXaQXCDZtzWxayl9/S5sc=' 
WHERE 
  key_id = 'b0d40d4d463f14068c2def0a8ce193674e363202d8a80fc448f6ec81ab016671' 
  AND (
    token = 'hhuKHt25NqGLF34MypYAKRnXaQXCDZtzWxayl9/S5sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00106