UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DOvPvUiwe6ITIp7emQlzaNFoIYApEcuDCtlSQ3CwIoE=' 
WHERE 
  key_id = 'a767cd546f95a5db1e53ee208eba3e43fa6dc66c282bc482bbd09182db25f359' 
  AND (
    token = 'DOvPvUiwe6ITIp7emQlzaNFoIYApEcuDCtlSQ3CwIoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023