UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WzxCvGfQ6f6k68kBGvD1i6Tfv5XY6tAGZOkMyhommMM=' 
WHERE 
  key_id = '5f12394669bb19ee9c1491f9f5534cb070cc7aabb5bd01ead29560e21f60ac4f' 
  AND (
    token = 'WzxCvGfQ6f6k68kBGvD1i6Tfv5XY6tAGZOkMyhommMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042