UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h/bq3LzSL/ojvdnKhQR4FAm4UNQHUSG7wPwATDNU7qk=' 
WHERE 
  key_id = '1e317f46f402e1615b9ce47883073ebd45903a495643075e37cba8e6d559b807' 
  AND (
    token = 'h/bq3LzSL/ojvdnKhQR4FAm4UNQHUSG7wPwATDNU7qk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035