UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZNDbDQ9Z9Dw0HPOmbWwFkdNGqzrmY/fU3vuQ4qLvntI=' 
WHERE 
  key_id = '4285d3edaff7f1dc0f204233cfe55fa47dddd4678b774d5fba277e1369201f5e' 
  AND (
    token = 'ZNDbDQ9Z9Dw0HPOmbWwFkdNGqzrmY/fU3vuQ4qLvntI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030