UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l8+UR4ZTsE+KPeKSE2kpgqko9Yg+IHpycBjMQsKjSyc=' 
WHERE 
  key_id = '8bd0dfd73aedfec3ce270d4281e2e4c8f2682a2539d2d47f3a6300d42e7269ee' 
  AND (
    token = 'l8+UR4ZTsE+KPeKSE2kpgqko9Yg+IHpycBjMQsKjSyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025