UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GBZBe7RYMviSX6bYaDWEzKEGR5jTvU/dn7n5GDtpJuE=' 
WHERE 
  key_id = '09c1d013a9913d44d75b86bdb2ede256e4c24ea274c31149a62e78710b084250' 
  AND (
    token = 'GBZBe7RYMviSX6bYaDWEzKEGR5jTvU/dn7n5GDtpJuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031