UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hx7/0wHgd1I+WHqTsqSjVGTlD6PBvx9ZuIAl7J6nehQ=' 
WHERE 
  key_id = 'a3969734234db3821d206ce12e34cd6f7322291b81b85ecc0e1a7f9517f14473' 
  AND (
    token = 'Hx7/0wHgd1I+WHqTsqSjVGTlD6PBvx9ZuIAl7J6nehQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031